﻿<%@ Page Title="" Language="C#" MasterPageFile="~/admin/MasterPage.master" AutoEventWireup="true" CodeFile="Show.aspx.cs" Inherits="admin_User_Show" %>
<%@ MasterType VirtualPath="~/admin/MasterPage.master" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="main" runat="Server">
    <!-- Content Wrapper. Contains page content -->
    <div class="content-wrapper">
        <!-- Content Header (Page header) -->
        <section class="content-header">
            <h1>用户管理
        <small>用户管理</small>
            </h1>
            <ol class="breadcrumb">
                <li><a href="#"><i class="fa fa-user"></i>用户管理</a></li>
                <li class="active">用户详细资料</li>
            </ol>
        </section>

        <!-- Main content -->
        <section class="content">

            <!-- Your Page Content Here -->
            <div class="row">
                <div class="col-md-3">
                    <div class="box box-solid">
                        <div class="box-header with-border">
                            <h3 class="box-title">用户管理</h3>

                            <div class="box-tools">
                                <button type="button" class="btn btn-box-tool" data-widget="collapse">
                                    <i class="fa fa-minus"></i>
                                </button>
                            </div>
                        </div>
                        <div class="box-body no-padding">
                            <ul class="nav nav-pills nav-stacked">
                                <li><a href="Default.aspx"><i class="fa fa-circle-o"></i>所有用户</a></li>
                                <li><a href="Writer.aspx"><i class="fa fa-circle-o"></i>新闻编辑者</a></li>
                                <li><a href="Ban.aspx"><i class="fa fa-circle-o"></i>黑名单</a></li>
                            </ul>
                        </div>
                        <!-- /.box-body -->
                    </div>
                </div>
                <div class="col-md-9">
                    <div class="box box-primary">
                        <div class="box-header with-border">
                            <h3 class="box-title">用户详细资料</h3>

                            <div class="box-tools pull-right">
                                <div class="has-feedback">
                                    <input type="text" class="form-control input-sm" placeholder="搜索 ...">
                                    <span class="glyphicon glyphicon-search form-control-feedback"></span>
                                </div>
                            </div>
                            <!-- /.box-tools -->
                        </div>
                        <!-- /.box-header -->
                        <div class="box-body no-padding">
                            <asp:DetailsView ID="DetailsView1" AutoGenerateRows="false" runat="server" CssClass="table" GridLines="None">
                                <Fields>
                                    <asp:TemplateField HeaderText="头像" HeaderStyle-Width="120px" HeaderStyle-Font-Bold="true">
                                        <ItemTemplate><img src='<%# Eval("photo") %>' width="72" class="user-image" alt="User Image"></ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="用户名" HeaderStyle-Width="120px" HeaderStyle-Font-Bold="true">
                                        <ItemTemplate><%# Eval("name") %></ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="邮箱" HeaderStyle-Font-Bold="true">
                                        <ItemTemplate><%# Eval("email") %></ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="性别" HeaderStyle-Font-Bold="true">
                                        <ItemTemplate><%# Eval("sex") %></ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="出生日期" HeaderStyle-Font-Bold="true">
                                        <ItemTemplate><%# Eval("birth") %></ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="教育" HeaderStyle-Font-Bold="true">
                                        <ItemTemplate><%# Eval("education") %></ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="地址" HeaderStyle-Font-Bold="true">
                                        <ItemTemplate><%# Eval("location") %></ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="个人签名" HeaderStyle-Font-Bold="true">
                                        <ItemTemplate><%# Eval("notes") %></ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="注册日期" HeaderStyle-Font-Bold="true">
                                        <ItemTemplate><%# Eval("created_at") %></ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="用户角色" HeaderStyle-Font-Bold="true">
                                        <ItemTemplate><%# Eval("display_name") %></ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="状态" HeaderStyle-Font-Bold="true">
                                        <ItemTemplate><%# Eval("ban").ToString() == "" ? "<b>正常</b>" : "<b class='text-danger'>禁用</b>" %></ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField>
                                        <ItemTemplate>
                                            <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#editRole">编辑角色</button>
                                            <button type="button" class="btn btn-danger" data-toggle="modal" data-target="#setBan">设置用户状态</button>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                </Fields>
                            </asp:DetailsView>
                        </div>
                        <!-- /.box-body -->
                    </div>
                </div>
            </div>
            <div class="modal fade" id="editRole" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
                <div class="modal-dialog modal-sm">
                    <div class="modal-content">
                        <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                            <h4 class="modal-title" id="myModalLabel">编辑角色</h4>
                        </div>
                        <div class="modal-body">
                            <asp:ListBox ID="ListBox1" runat="server" CssClass="form-control">
                                <asp:ListItem Selected="True" Value="3">
                                    用户
                                </asp:ListItem>
                                <asp:ListItem Value="2">
                                    新闻发布者
                                </asp:ListItem>
                                <asp:ListItem Value="1">
                                    管理员
                                </asp:ListItem>
                            </asp:ListBox>
                        </div>
                        <div class="modal-footer">
                            <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                            <asp:Button ID="Button1" runat="server" Text="设定" CssClass="btn btn-primary" OnClick="Set_Role" />
                        </div>
                    </div>
                </div>
            </div>
            <div class="modal fade" id="setBan" tabindex="-1" role="dialog" aria-labelledby="ModalLabel" aria-hidden="true">
                <div class="modal-dialog modal-sm">
                    <div class="modal-content">
                        <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                            <h4 class="modal-title" id="ModalLabel">设置用户状态</h4>
                        </div>
                        <div class="modal-body">
                            <asp:ListBox ID="ListBox2" runat="server" CssClass="form-control">
                                <asp:ListItem Selected="True" Value="normal">
                                    正常
                                </asp:ListItem>
                                <asp:ListItem Value="ban">
                                    禁用
                                </asp:ListItem>
                            </asp:ListBox>
                        </div>
                        <div class="modal-footer">
                            <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                            <asp:Button ID="Button2" runat="server" Text="设定" CssClass="btn btn-primary" OnClick="Set_State" />
                        </div>
                    </div>
                </div>
            </div>
        </section>
        <!-- /.content -->
    </div>
    <!-- /.content-wrapper -->
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="script" runat="Server">
</asp:Content>

